import { message } from "antd";
import request from "../utils/request";

export const queryConfig = (data: any) => {
  return request({
    url: "/root/siteManager/queryConfig",
    data,
    method: "POST",
  });
};
export const queryPageConfig = (data: any) => {
  return request({
    url: "/root/siteManager/findSiteMenu",
   data,
    method: "POST",
  });
};
export const userLogin = (data: any) => {
  return request({
    url: "/user/login",
    data,
    method: "POST",
  });
};
export const queryProjectList = (data: any) => {
  return request({
    url: "/root/apiManager/queryProjectList",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const querySiteList = (data: any) => {
  return request({
    url: "/root/siteManager/queryList",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const saveSite = (data: any) => {
  return request({
    url: "/root/siteManager/save",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const saveProject = (data: any) => {
  return request({
    url: "/root/apiManager/saveProject",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const queryApiGroup = (data: any) => {
  return request({
    url: "/root/apiManager/queryApiGroup",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const saveApiGroup = (data: any) => {
  return request({
    url: "/root/apiManager/saveApiGroup",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const queryDataSource = (data: any) => {
  return request({
    url: "/root/apiManager/queryDataSource",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const queryApi = (data: any) => {
  return request({
    url: "/root/apiManager/queryApi",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const saveApi = (data: any) => {
  return request({
    url: "/root/apiManager/saveApi",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};

export const createApi = (data: any) => {
  return request({
    url: "/root/apiManager/createApi",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const findApi = (data: any) => {
  return request({
    url: "/root/apiManager/findApi",
    params: data,
    // autoHandleError: false,
    method: "get",
  });
};
export const findApiProjectDetail = (data: any) => {
  return request({
    url: "/root/apiManager/findApiProjectDetail",
    params: data,
    // autoHandleError: false,
    method: "get",
  });
};
export const saveMaterial = (data: any) => {
  return request({
    url: "/root/materialManager/save",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const queryMaterialList = (data: any) => {
  return request({
    url: "/root/materialManager/queryList",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};

export const querySiteMenu = (data: any) => {
  return request({
    url: "/root/siteManager/querySiteMenu",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const saveSiteMenu = (data: any) => {
  return request({
    url: "/root/siteManager/saveSiteMenu",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
export const findSiteMenu = (data: any) => {
  return request({
    url: "/root/siteManager/findSiteMenu",
    data,
    // autoHandleError: false,
    method: "POST",
  });
};
